-- GENERATED SPELL FOR [Ember Clutch Ancient] --


function spell0_23870(pUnit, Event) --@Entangling Roots,n/a--
pUnit:FullCastSpellOnTarget(37823,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23870', 11500, 1)
end

function spell1_23870(pUnit, Event) --@Rejuvenation,Self--
pUnit:FullCastSpellOnTarget(42544,pUnit)
pUnit:RegisterEvent('Sorts_23870', 12000, 1)
end

function spell2_23870(pUnit, Event) --@Stomp,n/a--
pUnit:FullCastSpellOnTarget(12612,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23870', 579, 1)
end

function spell3_23870(pUnit, Event) --@Wild Regeneration,Self--
pUnit:FullCastSpellOnTarget(37709,pUnit)
pUnit:RegisterEvent('Sorts_23870', 13000, 1)
end

function Sorts_23870(pUnit, Event)
local choix_sorts_23870 = math.random(0, 3)
if choix_sorts_23870 == 0 then
pUnit:RegisterEvent('spell0_23870', 1, 1)
end
if choix_sorts_23870 == 1 then
pUnit:RegisterEvent('spell1_23870', 1, 1)
end
if choix_sorts_23870 == 2 then
pUnit:RegisterEvent('spell2_23870', 1, 1)
end
if choix_sorts_23870 == 3 then
pUnit:RegisterEvent('spell3_23870', 1, 1)
end
end

function mob23870_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23870', math.random(1500, 3000), 1)
end

function mob23870_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23870_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23870_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23870, 1, 'mob23870_Action')
RegisterUnitEvent(23870, 2, 'mob23870_Leave')
RegisterUnitEvent(23870, 3, 'mob23870_Kill')
RegisterUnitEvent(23870, 4, 'mob23870_Die')
